<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>
	<link rel="stylesheet" href="../layui/css/layui.css" media="all" />
</head>
<style>
	input[type="text"]{width: 300px;}
	.div{width: 500px;height: 450px;margin-left: 30px;}
	::-webkit-scrollbar {display:none}/*隐藏横向滚动条但可以滚动*/
</style>
<body>
<div class="div">
	<form class="layui-form" action="">
		<div class="layui-form-item">
			<label class="layui-form-label">学校名称:</label>
			<div class="layui-input-block">
				<input type="text" name="collegename" required  lay-verify="required" placeholder="请输入学校名称" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">学    历 : </label>
			<div class="layui-input-block">
				<input type="text" name="degree" required  lay-verify="required" placeholder="请输入学历 " autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">入校时间: </label>
			<div class="layui-input-block">
				<input style="width: 300px;" type="date" id="hireDay" name="startdate" required  lay-verify="required" placeholder="请输入入校时间" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">毕业时间:</label>
			<div class="layui-input-block">
				<input style="width: 300px;" type="date" id="fireDay" name="enddate" required  lay-verify="required" placeholder="请输入毕业时间" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item layui-form-text"  style="width: 400px;">
			<label class="layui-form-label">奖惩情况 : </label>
			<div class="layui-input-block">
				<textarea name="remark" placeholder="请输入内容" class="layui-textarea"></textarea>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn layui-btn-radius layui-btn-normal" lay-submit lay-filter="formDemo">保存</button>
				<button type="reset" class="layui-btn layui-btn-radius layui-btn-primary ">重置</button>
			</div>
		</div>
	</form>
</div>

</body>
<script src="../js/jquery/jquery-3.1.0.min.js"></script>
<script src="../layui/layui.js"></script>
<script>
	layui.use(['form','element','upload','laydate'], function(){
		var $ = layui.jquery
				,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
		var form=layui.form;
		var laydate=layui.laydate;

		//监听提交
		//你可以在这里做操作  也可以不使用这个方法
		form.on('submit(formDemo)', function(data){
			$.ajax({
				url: '/option/educationadd',
				type: 'post',
				data:data.field,
				dataType: 'json',
				success:function(data){
					if(data){
						//先得到当前iframe层的索引
						var index = parent.layer.getFrameIndex(window.name);
						//再执行关闭
						parent.layer.close(index);
						layer.msg(JSON.stringify("添加成功"));
						window.parent.location.reload();
					}else {
						layer.msg('添加失败', { icon: 5, time: 2000 });
					}
				},
			})
			return false;
		});
	});
</script>
</html>